﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Web_rongmeiti_sys.PublishToRongMeiTi
{
    /// <summary>
    /// 比较两个Match的url是否一致
    /// </summary>
    /// 创建 2023-7-12 14:30:12，作者：王浩力
    public class EqualityComparer_URL : IEqualityComparer<Match>
    {
        public bool Equals(Match? x, Match? y)
        {
            if (x != null && y != null
                && !string.IsNullOrWhiteSpace(x.Value)
                && !string.IsNullOrWhiteSpace(y.Value)
                && x.Value.Equals(y.Value))
            {
                return true;
            }
            return false;
        }

        public int GetHashCode([DisallowNull] Match obj)
        {
            return obj.Value.GetHashCode();
        }
    }
}
